Skip to content

Add comprehensive documentation for ExecutableResource and AddExecutable API #4188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 11, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

This PR adds a new comprehensive article documenting how to use ExecutableResource and the AddExecutable extension method in .NET Aspire app hosts. The documentation was missing entirely, leaving developers without guidance on how to host external executable applications.

What's included

The new article docs/app-host/executable-resources.md covers:

  • Basic usage of AddExecutable with command-line arguments and working directories
  • Command-line argument configuration by passing arguments directly to the AddExecutable method
  • Resource dependency management with WithReference calls and automatic connection string injection
  • Practical Vercel CLI example demonstrating real-world usage
  • Publishing scenarios with PublishAsDockerfile for deployment
  • Best practices for production use

Key examples

The article includes practical examples for common scenarios:

// Basic executable with arguments (correct parameter order)
var app = builder.AddExecutable("vercel-dev", "vercel", ".", "dev", "--listen", "3000");

// Resource dependencies with automatic connection string injection
var redis = builder.AddRedis("cache");
var app = builder.AddExecutable("worker", "python", ".", "worker.py")
    .WithReference(redis);      // Automatically provides connection strings

// Publishing for deployment
var app = builder.AddExecutable("frontend", "npm", ".", "start")
    .PublishAsDockerfile();

The documentation addresses the specific use case mentioned in the issue (external executable hosting) while providing comprehensive coverage for any external executable scenario using modern tooling like Vercel CLI.

Important: All examples correctly use the AddExecutable API signature where arguments are passed as params string[] args directly to the method. There is no WithArgs() method available on ExecutableResource.

Fixes #1381.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.


Internal previews

📄 File 🔗 Preview link
docs/app-host/executable-resources.md docs/app-host/executable-resources
docs/toc.yml docs/toc

@Copilot Copilot AI changed the title [WIP] [New article]: Using ExecutableResource Add comprehensive documentation for ExecutableResource and AddExecutable API Aug 4, 2025
Copilot finished work on behalf of IEvangelist August 4, 2025 20:41
@Copilot Copilot AI requested a review from IEvangelist August 4, 2025 20:41
…zure SWA CLI with Vercel CLI

Co-authored-by: IEvangelist <[email protected]>
Copilot finished work on behalf of IEvangelist August 4, 2025 20:52
@Copilot Copilot AI requested a review from IEvangelist August 4, 2025 20:52
Copilot finished work on behalf of IEvangelist August 4, 2025 20:59
…meters section, correct AddExecutable parameter order, and update examples

Co-authored-by: IEvangelist <[email protected]>
Copilot finished work on behalf of IEvangelist August 11, 2025 14:32
@Copilot Copilot AI requested a review from IEvangelist August 11, 2025 14:32
@IEvangelist IEvangelist marked this pull request as ready for review August 11, 2025 16:39
@IEvangelist IEvangelist requested review from adegeo and Copilot August 11, 2025 16:51
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive documentation for the ExecutableResource and AddExecutable API in .NET Aspire, filling a significant gap in the documentation. The new guide provides developers with clear instructions on how to host external executable applications within their Aspire app hosts.

Key changes:

  • New comprehensive documentation article covering ExecutableResource and AddExecutable usage
  • Practical examples including Vercel CLI integration and resource dependency management
  • Publishing guidance with PublishAsDockerfile for production deployment
  • Table of contents entry for discoverability

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/app-host/executable-resources.md New comprehensive documentation article covering ExecutableResource API usage, examples, and best practices
docs/toc.yml Added table of contents entry for the new executable resources documentation

@Copilot Copilot AI requested a review from IEvangelist August 11, 2025 17:04
Copilot finished work on behalf of IEvangelist August 11, 2025 17:04
@Copilot Copilot AI requested a review from IEvangelist August 11, 2025 18:41
Copilot finished work on behalf of IEvangelist August 11, 2025 18:41
Copilot finished work on behalf of adegeo August 11, 2025 20:46
@Copilot Copilot AI requested a review from adegeo August 11, 2025 20:46
Copilot finished work on behalf of adegeo August 11, 2025 20:48
@Copilot Copilot AI requested a review from adegeo August 11, 2025 20:48
@IEvangelist IEvangelist enabled auto-merge (squash) August 11, 2025 23:20
@IEvangelist IEvangelist merged commit 9c0b581 into main Aug 11, 2025
9 checks passed
@IEvangelist IEvangelist deleted the copilot/fix-1381 branch August 11, 2025 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New article]: Using ExecutableResource
3 participants